package cn.yuanqiao.activiti.domain;

import cn.yuanqiao.activiti.domain.dto.ProcessInstanceDTO;
import cn.yuanqiao.common.core.domain.BaseEntity;
import org.activiti.api.task.model.Task;
import org.activiti.engine.runtime.ProcessInstance;

import java.util.List;
import java.util.Objects;

/**
 * @ClassName: ActivitiPackage
 * @Description: 类的描述
 * @author: lihuahua
 * @date: 2023/6/13 15:30
 * @Blog: huahuacoco.top
 */

public class ActivitiPackage extends BaseEntity {

    public ActivitiPackage(){
    }

    public ActivitiPackage(ProcessInstance processInstance){
        this.processInstance = new ProcessInstanceDTO(processInstance);
    }

    public ActivitiPackage(Task task, ProcessInstance processInstance){
        this.processInstance = new ProcessInstanceDTO(processInstance);
        this.task = task;
    }

    public ActivitiPackage(List<ProcessInstance> processInstanceList){
        this.processInstanceList = processInstanceList;
    }

    private ProcessInstance processInstance;

    private List<ProcessInstance> processInstanceList;


    private Task task;

    private String bussinessKey;

    private String tableName;

    public String getBussinessKey() {
        return bussinessKey;
    }

    public void setBussinessKey(String bussinessKey) {
        this.bussinessKey = bussinessKey;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Task getTask() {
        return task;
    }

    public void setTask(Task task) {
        this.task = task;
    }

    public ProcessInstance getProcessInstance() {
        return processInstance;
    }

    public void setProcessInstance(ProcessInstance processInstance) {
        this.processInstance = new ProcessInstanceDTO(processInstance);
    }

    public List<ProcessInstance> getProcessInstanceList() {
        return processInstanceList;
    }

    public void setProcessInstanceList(List<ProcessInstance> processInstanceList) {
        this.processInstanceList = processInstanceList;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ActivitiPackage that = (ActivitiPackage) o;
        return Objects.equals(processInstance, that.processInstance);
    }

    @Override
    public int hashCode() {
        return Objects.hash(processInstance);
    }
}
